<!--非主页横幅组件-->
<template>
  <div class="picture">
    <img :src="secondaryPicture.secondary_picture_url"   alt="横幅">
  </div>
</template>

<script>
import service from '@/utils/service';
export default {
  data(){
    return {
      secondaryPicture:{},

    };
  },
  methods:{
    async getSecondaryPicture(){
      try{
        const relativeUrl = '/secondary';
        const response = await service.get(relativeUrl);

        if(response.data.code === 20041){
          this.secondaryPicture = response.data.data;
          console.log(this.secondaryPicture);
        }

      }catch{
        console.log('获取副页图片出错');

      }

    }
  },
  created(){
    this.getSecondaryPicture();
  }




}
</script>

<style scoped>
.picture {
  width: 100%;
}

img{
  width: 100%;
  height: 400px;
  object-fit: cover;
}
</style>
